package com.example.mapper;

import com.example.domain.Mainzone;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface MainzoneMapper {

    @Select("select * from wmy.mainzone")
    List<Mainzone> getAll();

    @Select("select * from wmy.mainzone where mainzone_id = #{mainzoneId}")
    Mainzone getById(Integer mainzoneId);

    @Insert("insert into wmy.mainzone (mainzone_name, mainzone_location, mainzone_level, mainzone_area, mainzone_viewpoint, mainzone_geographical_environment, mainzone_culture) values (#{mainzoneName}, #{mainzoneLocation}, #{mainzoneLevel}, #{mainzoneArea}, #{mainzoneViewpoint}, #{mainzoneGeographicalEnvironment}, #{mainzoneCulture})")
    boolean add(Mainzone mainzone);

    @Update("update wmy.mainzone set mainzone_name=#{mainzoneName},mainzone_location=#{mainzoneLocation},mainzone_level=#{mainzoneLevel},mainzone_area=#{mainzoneArea},mainzone_viewpoint=#{mainzoneViewpoint},mainzone_geographical_environment=#{mainzoneGeographicalEnvironment},mainzone_culture=#{mainzoneCulture} where mainzone_id = #{mainzoneId}")
    boolean update(Mainzone mainzone);

    @Delete("delete from wmy.mainzone where mainzone_id = #{mainzoneId}")
    boolean delete(Integer mainzoneId);

}
